package com.freesky.web.manager.remote.panel;

import com.freesky.common.dao.entity.PanelContent;
import com.freesky.common.pojo.DataTablesResult;
import com.freesky.common.pojo.ZTreeNode;
import com.freesky.common.utils.reponse.JSONResponse;
import com.freesky.web.manager.remote.panel.fallback.OtherPanelContentRemoteFallback;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "emall-provider-zuul", fallback = OtherPanelContentRemoteFallback.class)
public interface OtherPanelContentRemote {
    String ZUUL_URL_PREFIX = "/mysevice/content";
    @GetMapping(value = ZUUL_URL_PREFIX +   "/other/panel/content/tree/list")
    List<ZTreeNode> treeList();

    @GetMapping(value = ZUUL_URL_PREFIX +  "/other/panel/content/list/{panelId}")
    DataTablesResult list(@PathVariable("panelId") int panelId);

    @DeleteMapping(value = ZUUL_URL_PREFIX +   "/other/panel/content/del/{ids}")
    JSONResponse delete(@PathVariable(value = "ids") int[] ids);

    @PostMapping(value = ZUUL_URL_PREFIX+"/other/panel/content/update")
    JSONResponse update(@RequestBody PanelContent panelContent);
}
